﻿#include "robot.h"

using namespace std;

int main(int argc, char *argv[])
{

    Robot robot;

    robot.connect_robot("192.168.1.100");
    robot.servo_power_on();
    Sleep(500);

    double pos[6];
    robot.get_current_position(pos,0);

    // int i = 100;
    // while (i--)
    // {
    //     robot.start_jogging(1, -1);
    //     Sleep(100);
    // }

    // robot.get_current_position(pos);
    // robot.stop_jogging(1);

    // i = 10;
    // while (i--)
    // {
    //     robot.start_jogging(1, -1);
    //     Sleep(100);
    // }

    double pos1[6] = {0,0,20.0,0,15.0,0};
    double pos2[6] = {0,0,0,0,0,0};

    robot.robot_movj(pos1,50,0);
    robot.robot_movl(pos2,100,0);

    robot.get_current_position(pos,0);
    // robot.stop_jogging(1);


   // Sleep(10000);
    robot.servo_power_off();

    //CRC32测试

    // char data[] = {0x00, 0x17, 0x20, 0x01, 0x7b, 0x22, 0x72, 0x6f, 0x62, 0x6f, 0x74, 0x22, 0x3a, 0x31, 0x2c, 0x22, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x22, 0x3a, 0x30, 0x7d, 0x0a};
    // unsigned int crc = CRC32(data,27);
    // cout<<crc<<endl;

    return 0;
}
